<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<!--Author :  DebugProject_Brebion_Bourdin-->
<!--Created : 28/02/07-->
<!--Modified : 05/06/07-->
<!--Script : create HTML page for Verification-->

<!--look for a log mark and color between the begining mark and the end mark-->
<xsl:template match="log">
<html>
	
	<head>
		<!--get the excution ID and the post list and use it as title-->
		<title> <xsl:value-of select="@execID"/> - posts = <xsl:value-of select="@pIDlist"/>
		</title>
	</head>

	<!--set the background color to white-->
	<body bgcolor="white">

		<!--for each msg mark, color the text between the begining mark and the end mark-->
		<xsl:for-each select="msg">


			<xsl:choose>
			<!--when the type attribute value is 'send'-->
			<xsl:when test="@type='send'">		
				<xsl:choose>
				<!--when the lost attribute value is 'yes', color the line background in brown, write the line number, write emission in blue and bold, write the sender number, the receiver number, the lost value and finally write the message content in grey-->
				<xsl:when test="@lost='yes'">		
					<li style="background : brown">
					<b><xsl:value-of select="position()"/></b> :<FONT Color="blue"><b>  emission  </b></FONT> <b> sender = </b> <xsl:value-of select="@sender"/> <b> rcver = </b> <xsl:value-of select="@rcver"/> <b> smh = </b> <xsl:value-of select="@smh"/>  <b> lost = </b> <xsl:value-of select="@lost"/>  =>  <FONT Color="grey"><xsl:value-of select="."/></FONT>
					</li>
				</xsl:when>

				<!--otherwise, just write the line number, the word emission in blue and bold, the sender number, the receiver number and finally write the message content in grey-->
				<xsl:otherwise>
					<li>
					<b><xsl:value-of select="position()"/></b> :<FONT Color="blue"><b>  emission </b> </FONT> <b> sender = </b> <xsl:value-of select="@sender"/> <b> rcver = </b> <xsl:value-of select="@rcver"/> <b> smh = </b> <xsl:value-of select="@smh"/> =>  <FONT Color="grey"><xsl:value-of select="."/></FONT>
					</li>
				</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
		

			<!--when the type attribute value is 'rcv'-->
			<xsl:when test="@type='rcv'">
				<xsl:choose>
				<!--when the dup attribute value is not '0', color the line background in green, write the line number, write reception in red and bold, write the sender number, the receiver number and finally the root value and the number of duplicated messages-->
				<xsl:when test="@dup!='0'">		
					<li style="background : green">
					<b><xsl:value-of select="position()"/></b> : <FONT Color="red"><b>  reception </b> </FONT> <b> sender = </b> <xsl:value-of select="@sender"/> <b> rcver = </b> <xsl:value-of select="@rcver"/> <b> smh = </b> <xsl:value-of select="@smh"/> <b> root = </b> <xsl:value-of select="@root"/> <b> dup = </b> <xsl:value-of select="@dup"/>
					</li>
				</xsl:when>
				
				<!--otherwise, just write the line number, the word reception in red and bold, the sender number and finally write the receiver number-->
				<xsl:otherwise>
					<li>
					<b><xsl:value-of select="position()"/></b> : <FONT Color="red"><b>  reception </b> </FONT> <b> sender = </b> <xsl:value-of select="@sender"/> <b> rcver = </b> <xsl:value-of select="@rcver"/> <b> smh = </b> <xsl:value-of select="@smh"/>
					</li>
				</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			</xsl:choose>
   
		</xsl:for-each>
	</body>
</html>
</xsl:template>
</xsl:stylesheet>
